<?php
include "include/config.php";
include "include/functions.php";

echo "<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'
        xmlns:image='http://www.sitemaps.org/schemas/sitemap-image/1.1'
        xmlns:video='http://www.sitemaps.org/schemas/sitemap-video/1.1'>";

$all_videos = get_all_videos();

for ($i = 1; $i <= count($all_videos)-1; $i++) {
        echo "<url>\n";  
		$link = htmlentities("http://".$_SERVER['HTTP_HOST']."/index.php?page=video_player&video_id=".$all_videos[$i]['id']);
        echo "<loc>".$link."</loc>\n";  
        echo "<lastmod>2007-04-09</lastmod>\n";  
        echo "<changefreq>daily</changefreq>\n";  
        echo "<priority>0.8</priority>\n";  
        echo "</url>\n";
}
  
echo "</urlset>\n";  
?> 
